// curriculum/pages/curriculum/curriculum.js
import {detail} from '../../../api/curriculum'
Page({

  data: {
    data:null,
    controlsShow:false,
    show:true,
    overlayShow:true,
    collect:true,
    active: 0,
    indexData:""
  },

  async onLoad(options) {
      console.log(options.id);  //此处暂时用id=151,上线时改回options.id
    let res = await detail(152)
    console.log(res);
    this.data.data=res.data.data
    let detail4=this.data.data.detailDesc.replace(/<img style="/gi,'<img style="max-width:100%; ');
    this.data.indexData =  detail4.replace(/<img /gi,'<img style="max-width:100%;"')
    // console.log(this.data.data);
    this.setData({
        data:this.data.data,
         videoCtx:wx.createVideoContext('myVideo', this),
         indexData:this.data.indexData
    })
  },
  f1(){
    // console.log("111");
    this.data.videoCtx.play() 
    this.setData({
        controlsShow:true,
        overlayShow:false
    })
  },
  collect(){
    this.setData({
        collect:!this.data.collect
    })
  },
  onClickLeft(){
    wx.navigateBack();
  },

})